<?php
/**
 * Profile
 *
 * PHP version 5
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */

/**
 * Amazon Ads API - Profiles
 *
 * Profiles represent an advertiser and their account's marketplace, and are used in all subsequent API calls via a management scope, `Amazon-Advertising-API-Scope`. Reports and all entity management operations are associated with a single profile. Advertisers cannot have more than one profile for each marketplace.  Advertisers who operate in more than one marketplace (for example, Amazon.com, Amazon.co.uk, Amazon.co.jp) will have only one profile associated with each marketplace. [**See this link**](https://advertising.amazon.com/API/docs/en-us/info/api-overview#api-endpoints) for a list of marketplaces associated with each endpoint.  To retrieve your profile IDs, call the listProfiles operation, and include a valid authorization access token in the header. Use a `profileId` from the returned list as the value for the management scope (`Amazon-Advertising-API-Scope`) in the headers for subsequent API calls.
 *
 * OpenAPI spec version: 3.0
 * 
 * Generated by:https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api.git
 * AmazonAdvertisingApi Codegen version: 3.0.51
 */
/**
 * NOTE: This class is auto generated by the AmazonAdvertisingApi code generator program.
 *https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 * Do not edit the class manually.
 */

namespace AmazonAdvertisingApi\Model;

use \ArrayAccess;
use \AmazonAdvertisingApi\ObjectSerializer;

/**
 * Profile Class Doc Comment
 *
 * @category Class
 * @package  AmazonAdvertisingApi
 * @author   vv_guo
 * @link    https://gitee.com/HuaLiLiDeDiDiao/amazon-advertising-api
 */
class Profile implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $AmazonAdvertisingApiModelName = 'Profile';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiTypes = [
        'profile_id' => 'int',
        'country_code' => '\AmazonAdvertisingApi\Model\CountryCode',
        'currency_code' => 'string',
        'daily_budget' => 'float',
        'timezone' => 'string',
        'account_info' => '\AmazonAdvertisingApi\Model\AccountInfo'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $AmazonAdvertisingApiFormats = [
        'profile_id' => 'int64',
        'country_code' => null,
        'currency_code' => null,
        'daily_budget' => null,
        'timezone' => null,
        'account_info' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiTypes()
    {
        return self::$AmazonAdvertisingApiTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function AmazonAdvertisingApiFormats()
    {
        return self::$AmazonAdvertisingApiFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'profile_id' => 'profileId',
        'country_code' => 'countryCode',
        'currency_code' => 'currencyCode',
        'daily_budget' => 'dailyBudget',
        'timezone' => 'timezone',
        'account_info' => 'accountInfo'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'profile_id' => 'setProfileId',
        'country_code' => 'setCountryCode',
        'currency_code' => 'setCurrencyCode',
        'daily_budget' => 'setDailyBudget',
        'timezone' => 'setTimezone',
        'account_info' => 'setAccountInfo'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'profile_id' => 'getProfileId',
        'country_code' => 'getCountryCode',
        'currency_code' => 'getCurrencyCode',
        'daily_budget' => 'getDailyBudget',
        'timezone' => 'getTimezone',
        'account_info' => 'getAccountInfo'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$AmazonAdvertisingApiModelName;
    }

    const CURRENCY_CODE_BRL = 'BRL';
    const CURRENCY_CODE_CAD = 'CAD';
    const CURRENCY_CODE_MXN = 'MXN';
    const CURRENCY_CODE_USD = 'USD';
    const CURRENCY_CODE_AED = 'AED';
    const CURRENCY_CODE_EUR = 'EUR';
    const CURRENCY_CODE_EGP = 'EGP';
    const CURRENCY_CODE_INR = 'INR';
    const CURRENCY_CODE_PLN = 'PLN';
    const CURRENCY_CODE_SAR = 'SAR';
    const CURRENCY_CODE_SEK = 'SEK';
    const CURRENCY_CODE__TRY = 'TRY';
    const CURRENCY_CODE_GBP = 'GBP';
    const CURRENCY_CODE_AUD = 'AUD';
    const CURRENCY_CODE_JPY = 'JPY';
    const CURRENCY_CODE_SGD = 'SGD';
    const TIMEZONE_AFRICACAIRO = 'Africa/Cairo';
    const TIMEZONE_AMERICASAO_PAULO = 'America/Sao_Paulo';
    const TIMEZONE_AMERICALOS_ANGELES = 'America/Los_Angeles';
    const TIMEZONE_ASIADUBAI = 'Asia/Dubai';
    const TIMEZONE_ASIAKOLKATA = 'Asia/Kolkata';
    const TIMEZONE_ASIARIYADH = 'Asia/Riyadh';
    const TIMEZONE_ASIASINGAPORE = 'Asia/Singapore';
    const TIMEZONE_ASIATOKYO = 'Asia/Tokyo';
    const TIMEZONE_AUSTRALIASYDNEY = 'Australia/Sydney';
    const TIMEZONE_EUROPEAMSTERDAM = 'Europe/Amsterdam';
    const TIMEZONE_EUROPEISTANBUL = 'Europe/Istanbul';
    const TIMEZONE_EUROPELONDON = 'Europe/London';
    const TIMEZONE_EUROPEPARIS = 'Europe/Paris';
    const TIMEZONE_EUROPESTOCKHOLM = 'Europe/Stockholm';
    const TIMEZONE_EUROPEWARSAW = 'Europe/Warsaw';
    const TIMEZONE_EUROPEBRUSSELS='Europe/Brussels';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getCurrencyCodeAllowableValues()
    {
        return [
            self::CURRENCY_CODE_BRL,
            self::CURRENCY_CODE_CAD,
            self::CURRENCY_CODE_MXN,
            self::CURRENCY_CODE_USD,
            self::CURRENCY_CODE_AED,
            self::CURRENCY_CODE_EUR,
            self::CURRENCY_CODE_EGP,
            self::CURRENCY_CODE_INR,
            self::CURRENCY_CODE_PLN,
            self::CURRENCY_CODE_SAR,
            self::CURRENCY_CODE_SEK,
            self::CURRENCY_CODE__TRY,
            self::CURRENCY_CODE_GBP,
            self::CURRENCY_CODE_AUD,
            self::CURRENCY_CODE_JPY,
            self::CURRENCY_CODE_SGD,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getTimezoneAllowableValues()
    {
        return [
            self::TIMEZONE_AFRICACAIRO,
            self::TIMEZONE_AMERICASAO_PAULO,
            self::TIMEZONE_AMERICALOS_ANGELES,
            self::TIMEZONE_ASIADUBAI,
            self::TIMEZONE_ASIAKOLKATA,
            self::TIMEZONE_ASIARIYADH,
            self::TIMEZONE_ASIASINGAPORE,
            self::TIMEZONE_ASIATOKYO,
            self::TIMEZONE_AUSTRALIASYDNEY,
            self::TIMEZONE_EUROPEAMSTERDAM,
            self::TIMEZONE_EUROPEISTANBUL,
            self::TIMEZONE_EUROPELONDON,
            self::TIMEZONE_EUROPEPARIS,
            self::TIMEZONE_EUROPESTOCKHOLM,
            self::TIMEZONE_EUROPEWARSAW,
            self::TIMEZONE_EUROPEBRUSSELS,
        ];
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['profile_id'] = isset($data['profile_id']) ? $data['profile_id'] : null;
        $this->container['country_code'] = isset($data['country_code']) ? $data['country_code'] : null;
        $this->container['currency_code'] = isset($data['currency_code']) ? $data['currency_code'] : null;
        $this->container['daily_budget'] = isset($data['daily_budget']) ? $data['daily_budget'] : null;
        $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null;
        $this->container['account_info'] = isset($data['account_info']) ? $data['account_info'] : null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getCurrencyCodeAllowableValues();
        if (!is_null($this->container['currency_code']) && !in_array($this->container['currency_code'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'currency_code', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        $allowedValues = $this->getTimezoneAllowableValues();
        if (!is_null($this->container['timezone']) && !in_array($this->container['timezone'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'timezone', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets profile_id
     *
     * @return int
     */
    public function getProfileId()
    {
        return $this->container['profile_id'];
    }

    /**
     * Sets profile_id
     *
     * @param int $profile_id profile_id
     *
     * @return $this
     */
    public function setProfileId($profile_id)
    {
        $this->container['profile_id'] = $profile_id;

        return $this;
    }

    /**
     * Gets country_code
     *
     * @return \AmazonAdvertisingApi\Model\CountryCode
     */
    public function getCountryCode()
    {
        return $this->container['country_code'];
    }

    /**
     * Sets country_code
     *
     * @param \AmazonAdvertisingApi\Model\CountryCode $country_code country_code
     *
     * @return $this
     */
    public function setCountryCode($country_code)
    {
        $this->container['country_code'] = $country_code;

        return $this;
    }

    /**
     * Gets currency_code
     *
     * @return string
     */
    public function getCurrencyCode()
    {
        return $this->container['currency_code'];
    }

    /**
     * Sets currency_code
     *
     * @param string $currency_code The currency used for all monetary values for entities under this profile. |Region|`countryCode`|Country Name|`currencyCode`| |-----|------|------|------| |NA|BR|Brazil|BRL| |NA|CA|Canada|CAD| |NA|MX|Mexico|MXN| |NA|US|United States|USD| |EU|AE|United Arab Emirates|AED| |EU|BE|Belgium|EUR| |EU|DE|Germany|EUR| |EU|EG|Egypt|EGP| |EU|ES|Spain|EUR| |EU|FR|France|EUR| |EU|IN|India|INR| |EU|IT|Italy|EUR| |EU|NL|The Netherlands|EUR| |EU|PL|Poland|PLN| |EU|SA|Saudi Arabia|SAR| |EU|SE|Sweden|SEK| |EU|TR|Turkey|TRY| |EU|UK|United Kingdom|GBP| |FE|AU|Australia|AUD| |FE|JP|Japan|JPY| |FE|SG|Singapore|SGD|
     *
     * @return $this
     */
    public function setCurrencyCode($currency_code)
    {
        $allowedValues = $this->getCurrencyCodeAllowableValues();
        if (!is_null($currency_code) && !in_array($currency_code, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'currency_code', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['currency_code'] = $currency_code;

        return $this;
    }

    /**
     * Gets daily_budget
     *
     * @return float
     */
    public function getDailyBudget()
    {
        return $this->container['daily_budget'];
    }

    /**
     * Sets daily_budget
     *
     * @param float $daily_budget Note that this field applies to Sponsored Product campaigns for seller type accounts only. Not supported for vendor type accounts.
     *
     * @return $this
     */
    public function setDailyBudget($daily_budget)
    {
        $this->container['daily_budget'] = $daily_budget;

        return $this;
    }

    /**
     * Gets timezone
     *
     * @return string
     */
    public function getTimezone()
    {
        return $this->container['timezone'];
    }

    /**
     * Sets timezone
     *
     * @param string $timezone The time zone used for all date-based campaign management and reporting. |Region|`countryCode`|Country Name|`timezone`| |------|-----|-----|------| |NA|BR|Brazil|America/Sao_Paulo| |NA|CA|Canada|America/Los_Angeles| |NA|MX|Mexico|America/Los_Angeles| |NA|US|United States|America/Los_Angeles| |EU|AE|United Arab Emirates|Asia/Dubai| |EU|BE|Belgium|Europe/Paris| |EU|DE|Germany|Europe/Paris| |EU|EG|Egypt|Africa/Cairo| |EU|ES|Spain|Europe/Paris| |EU|FR|France|Europe/Paris| |EU|IN|India|Asia/Kolkata| |EU|IT|Italy|Europe/Paris| |EU|NL|The Netherlands|Europe/Amsterdam| |EU|PL|Poland|Europe/Warsaw| |EU|SA|Saudi Arabia|Asia/Riyadh| |EU|SE|Sweden|Europe/Stockholm| |EU|TR|Turkey|Europe/Istanbul| |EU|UK|United Kingdom|Europe/London| |FE|AU|Australia|Australia/Sydney| |FE|JP|Japan|Asia/Tokyo| |FE|SG|Singapore|Asia/Singapore|
     *
     * @return $this
     */
    public function setTimezone($timezone)
    {
        $allowedValues = $this->getTimezoneAllowableValues();
        if (!is_null($timezone) && !in_array($timezone, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'timezone', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['timezone'] = $timezone;

        return $this;
    }

    /**
     * Gets account_info
     *
     * @return \AmazonAdvertisingApi\Model\AccountInfo
     */
    public function getAccountInfo()
    {
        return $this->container['account_info'];
    }

    /**
     * Sets account_info
     *
     * @param \AmazonAdvertisingApi\Model\AccountInfo $account_info account_info
     *
     * @return $this
     */
    public function setAccountInfo($account_info)
    {
        $this->container['account_info'] = $account_info;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     *
     * @param integer $offset Offset
     * @param mixed   $value  Value to be set
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    #[\ReturnTypeWillChange]
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
